<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
  <title>Title</title>

  <link th:href="@{|/webjars/bootstrap/4.3.1/css/bootstrap.min.css?参数名称=${10}|}" rel="stylesheet"/>
  <script th:src="@{/webjars/jquery/jquery.min.js}" src="/webjars/jquery/3.0.0/jquery.min.js"
          type="text/javascript"></script>
  <script th:src="@{/webjars/bootstrap/js/bootstrap.bundle.min.js}"
          src="/webjars/bootstrap/4.3.1/js/bootstrap.bundle.min.js" type="text/javascript"></script>
</head>
<body>
<div class="container-fluid pt-2">
  <!--<h1>这是thymeleaf模板页面的内容。</h1>

  <h2 th:text="${str}">这里显示Controller方法中的str变量</h2>
  <h2>${str}</h2>
  <h2 th:text="${time}">time变量的值</h2>-->

  <form action="/" class="form-inline">
    <div class="form-group">
      <label for="deptno">部门</label>
      <select id="deptno" name="deptno" class="form-control">
        <option value="">全部</option>
        <option
                th:each="dept,state : ${depts}"
                th:value="${dept.deptno}"
                th:text="${dept.dname}"
                th:selected="${#strings.equals(param.deptno, dept.deptno)}">部门名称
        </option>
      </select>
    </div>
    <button class="btn btn-success">查询</button>
  </form>
  <hr/>
  <a th:href="@{/(pageNum=${pageInfo.pageNum},pageSize=${pageInfo.pageSize})}">新增员工信息</a>
  <h1>员工列表</h1>
  <table class="table table-hover table-striped table-sm">
    <thead class="thead-dark">
    <tr>
      <th>编号</th>
      <th>姓名</th>
      <th>职位</th>
      <th>上级</th>
      <th>入职日期</th>
      <th>薪资</th>
      <th>金奖</th>
      <th>部门</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="emp:${pageInfo.list}">
      <td th:text="${emp.empno}">EMPNO</td>
      <td th:text="${emp.ename}"></td>
      <td th:text="${emp.job}"></td>
      <td th:text="${(emp.manager?.ename)}?:_">-</td>
      <td th:text="${#dates.format(emp.hiredate, 'yyyy-MM-dd')}"></td>
      <td th:text="${#numbers.formatCurrency(emp.sal)}"></td>
      <td th:text="${#numbers.formatCurrency(emp.comm)}?:_">无金奖</td>
      <td th:text="${emp.dept?.dname}"></td>
      <td></td>
    </tr>
    <tr th:if="${#lists.isEmpty(pageInfo.list)}">
      <td colspan="9" align="center">没有数据</td>
    </tr>
    </tbody>
  </table>

  <form action="/">
    <input type="hidden" name="deptno" th:value="${param.deptno}"/>
    <span>跳到第</span>
    <select name="pageNum">
      <option
              th:each="page:${pageInfo.navigatepageNums}"
              th:selected="${#strings.equals(param.pageNum, page)}"
              th:value="${page}"
              th:text="${page}">页码
      </option>
    </select>
    <span>页，页每页显示</span>
    <select name="pageSize">
      <option th:selected="${#strings.equals(pageInfo.pageSize, 2)}" value="2">2</option>
      <option th:selected="${#strings.equals(pageInfo.pageSize, 5)}" value="5">5</option>
      <option th:selected="${#strings.equals(pageInfo.pageSize, 10)}" value="10">10</option>
      <option th:selected="${#strings.equals(pageInfo.pageSize, 20)}" value="20">20</option>
    </select>
    <span>行数据。</span>
    <button>GO</button>
  </form>
</div>


</body>
</html>